package com.yyx.up.analysis.kv;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * Description: 自定义分析数据Value
 * @Author: yyx
 * @Create: 2023/5/7 2:39
 * @Version: 8
 */
public class AnalysisValue implements Writable {
    private String sumWatch;
    private String sumDuration;

    public String getSumWatch() {
        return sumWatch;
    }

    public void setSumWatch(String sumWatch) {
        this.sumWatch = sumWatch;
    }

    public String getSumDuration() {
        return sumDuration;
    }

    public void setSumDuration(String sumDuration) {
        this.sumDuration = sumDuration;
    }

    public AnalysisValue(){

    }

    public AnalysisValue(String sumWatch,String sumDuration){
        this.sumWatch = sumWatch;
        this.sumDuration = sumDuration;
    }

    /**
     * 写数据
     * @param dataOutput
     * @throws IOException
     */
    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeUTF(sumWatch);
        dataOutput.writeUTF(sumDuration);
    }

    /**
     * 读数据
     * @param dataInput
     * @throws IOException
     */
    @Override
    public void readFields(DataInput dataInput) throws IOException {
        sumWatch = dataInput.readUTF();
        sumDuration = dataInput.readUTF();
    }
}
